Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lending Liquidator V1 #21

Merged
merged 19 commits into from
Mar 20, 2023
Merged

Lending Liquidator V1 #21

merged 19 commits into from
Mar 20, 2023

Conversation

daniel-savu
Copy link
Contributor

@daniel-savu daniel-savu commented Feb 28, 2023

Closes #15

  • Liquidates loans that the bot's balance can repay (no DEX swaps)
  • Attempts to redeem the qToken liquidations reward so the underlying can be used for future liquidations
  • Uses a greedy strategy to find the most profitable liquidation (the most valuable collateral currency of the borrower with the largest debt, considering what the bot can repay and the close factor of that market)
  • On each block, queries the chain to compute undercollateralizations
  • (You can ignore this one) Upgrades the bridge-tester to a more recent lib version - was checking to see if yarn build and yarn test are successful across all workspaces

@daniel-savu daniel-savu marked this pull request as draft February 28, 2023 17:20
@daniel-savu daniel-savu marked this pull request as ready for review March 10, 2023 17:31
@daniel-savu daniel-savu force-pushed the lending-liquidator branch 2 times, most recently from f74ab45 to 3d4307c Compare March 14, 2023 13:22
@daniel-savu daniel-savu changed the title wip: TDD for lending-liquidator, upgrade to latest interbtc-api Lending Liquidator V1 Mar 14, 2023
Copy link

@bvotteler bvotteler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just a couple of minor things to clarify/check

bots/lending-liquidator/README.md Outdated Show resolved Hide resolved
bots/lending-liquidator/package.json Outdated Show resolved Hide resolved
bots/lending-liquidator/src/liquidate.ts Outdated Show resolved Hide resolved
bots/lending-liquidator/test/utils.ts Outdated Show resolved Hide resolved
@nud3l
Copy link
Member

nud3l commented Mar 15, 2023

Nice one, thanks @daniel-savu !

Copy link

@peterslany peterslany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this! 🤖

bots/bridge-tester/package.json Show resolved Hide resolved
bots/lending-liquidator/src/index.ts Show resolved Hide resolved
bots/lending-liquidator/src/liquidate.ts Show resolved Hide resolved
bots/lending-liquidator/src/liquidate.ts Outdated Show resolved Hide resolved
bots/lending-liquidator/src/liquidate.ts Outdated Show resolved Hide resolved
bots/lending-liquidator/src/liquidate.ts Outdated Show resolved Hide resolved
bots/lending-liquidator/src/liquidate.ts Outdated Show resolved Hide resolved
@daniel-savu daniel-savu requested a review from philippb90 March 16, 2023 16:58
@daniel-savu daniel-savu merged commit db74d1e into master Mar 20, 2023
@daniel-savu daniel-savu deleted the lending-liquidator branch March 20, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Liquidate undercollateralized borrowers
5 participants